package com.xiaoshuidi.cloud.module.finance.dal.mysql.voucher;

import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.framework.mybatis.core.query.QueryWrapperX;
import com.xiaoshuidi.cloud.module.finance.controller.admin.order.vo.PayOrderPageReqVO;
import com.xiaoshuidi.cloud.module.finance.controller.admin.voucher.vo.FinanceVoucherInfoSearchReqVO;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.certificate.FinanceCertificateConfigDO;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.order.PayOrderDO;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.voucher.FinanceVoucherInfoDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface FinanceVoucherInfoMapper extends BaseMapperX<FinanceVoucherInfoDO> {

		default PageResult<FinanceVoucherInfoDO> selectPage(FinanceVoucherInfoSearchReqVO reqVO) {
				return selectPage(reqVO, new QueryWrapperX<FinanceVoucherInfoDO>()
												.eqIfPresent("company_code", reqVO.getCompanyCode())
												.eqIfPresent("voucher_type", reqVO.getVoucherType())
												.eqIfPresent("status", reqVO.getStatus())
												.eqIfPresent("book_time", reqVO.getBookTime())
												.eqIfPresent("business_time", reqVO.getBusinessTime())
												.orderByDesc("id"));
		}
}
